home *** CD-ROM | disk | FTP | other *** search
- Hello!
-
- > Yeah, sorry about that. I'm not great with sorting algorithms. I've been
- > told that a flag would be a good idea, but I'm not sure how to implement
- > it. How about an updated algorithm?
-
- A sorting algorithm with a flag is done in this way.
-
- Repeat
- FLAG=False
- For T=1 to N
- If A(T)>A(T+1)
- Swap A(T),A(T+1)
- FLAG=True
- End If
- Next
- Until Not FLAG
-
- ...well, actually I have no time now to see if I did stupid mistakes.
- Moreover you can implement the check (>) and the swap routine as you need
- them.
-
- Bye
-
- berionne@flashnet.it >>Flagger<<
- +---------------------------------------------------------------+
- | BASIC programmers never die, they GOSUB and don't RETURN. |
- +---------------------------------------------------------------+
-
-
-